PM_FUNC_NORM_ATTRIB SKILL:SkillAgility( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Agility", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 30, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Greatly increases Speed." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillAmnesia( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Amnesia", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 20, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Greatly increases Special." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillBarrier( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Barrier", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 30, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Greatly increases Defense." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillConfusion( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Confusion", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 25, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Damages and may Confuse enemy." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillDreamEater( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Dream Eater", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 15, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "While enemy Pokemon Sleeps, Pokemon absorbs HP." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillHypnosis( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Hypnosis", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 20, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Puts enemy to Sleep." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillKinesis( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Kinesis", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 15, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Decreases enemy's accuracy rating. Can only be accessed by using Metronome." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillLightScreen( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Light Screen", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 30, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Decreases damage from Special Attacks by 50%." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillMeditate( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Meditate", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 40, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Increases Attack." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillPsybeam( SKILL_CALL:iCall, Int:id )
{
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Psybeam", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN|CALL_ENTITY_THINK|CALL_ENTITY_TOUCH|CALL_RESET, .PP = 20, .Charges = 1, .DelayTime = 15.0 );
		case CALL_HELP:     return SkillHelp( "Guide a beam that damages on contact." );
		case CALL_BIND_DOWN:
		{
			SoundCast( id );

			new Int:iDamage = StatClamp( id, STAT_ATTACK, 30, 60 );

			new Int:iEnt = EntitySkillCreate( .iPlayer = id,
											.fThinkTime = 0.1,
											.iDamage = iDamage,
											.fRadius = StatClamp( id, STAT_SPECIAL, 300.0, 600.0 ),
											.iProperty = SEP_THINK|SEP_TOUCH|SEP_AOEDAMAGE|SEP_KILL,
											.iMoveType = MOVETYPE_FLY,
											.iSolidType = SOLID_TRIGGER,
											.iModel = MODEL_SKULL,
											.iSound = SOUND_TU_FIRE,
											.iSprite = SPRITE_EXPLODE1,
											.bPlayerOrigin = true,
											.bPlayerAngles = true,
											.vMins = Vector:{-5.0,-5.0,-5.0},
											.vMaxs = Vector:{5.0,5.0,5.0}
											);

			set_pev( iEnt, pev_rendermode, 5 );
			set_pev( iEnt, pev_renderamt, 255.0 );

			attach_view( id, iEnt );

			EffectBeamFollow( .iEnt = iEnt,
								.iSprite = SPRITE_TRAIL,
								.fLife = iDamage / 10.0,
								.iWidth = 7,
								.iRed = 255,
								.iGreen = 255,
								.iBlue = 255,
								.iBrightness = 255
							);

			EffectScreenFlash( .iPlayer = id,
								.iRed = 255,
								.iGreen = 0,
								.iBlue = 255,
								.iAlpha = 150,
								.fTime = 5.0,
								.iFadeFlags = FFADE_STAYOUT
							);

			return SKILL_WAIT;
		}
		case CALL_ENTITY_THINK:
		{
			new Int:iEnt = g_iAttacker;

			new Vector:vVelocity[3], Vector:vAngles[3];
			velocity_by_aim( id, StatClamp( id, STAT_SPEED, 100, 500 ), vVelocity );
			EntitySetVelocity( iEnt, vVelocity );

			pev( id, pev_v_angle, vAngles );
			EntitySetAngles( iEnt, vAngles );

			return SKILL_READY;
		}
		case CALL_ENTITY_TOUCH:
		{
			EffectScreenFlash( .iPlayer = id,
								.iRed = 255,
								.iGreen = 0,
								.iBlue = 255,
								.iAlpha = 150,
								.fTime = 1.0,
								.iFadeFlags = FFADE_IN
							);

			if ( is_user_alive( id ) )
			{
				attach_view( id, id );

				return SKILL_USED;
			}
		}
		case CALL_RESET:
		{
			if ( !EntityValid( SkillEntity( id ) ) )
				return SKILL_READY;

			EffectScreenFlash( .iPlayer = id,
								.iRed = 255,
								.iGreen = 0,
								.iBlue = 255,
								.iAlpha = 150,
								.fTime = 1.0,
								.iFadeFlags = FFADE_IN
							);

			if ( is_user_alive( id ) )
			{
				attach_view( id, id );

				return SKILL_READY;
			}
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillPsychic( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Psychic", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 10, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Damages and may decrease enemy's Special." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillPsywave( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Psywave", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 15, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Damage caused is equal to 1.5 times Pokemon's EXP Level." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillReflect( SKILL_CALL:iCall, Int:id )
{
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Reflect", .Type = TYPE_PSYCHIC, .callTypes = CALL_TAKE_DAMAGE, .PP = 20, .Charges = 5, .DelayTime = 10.0 );
		case CALL_HELP:     return SkillHelp( "Decreases damage from Physical Attacks." );
		case CALL_TAKE_DAMAGE:
		{
			if ( g_fDamage > 0.0 )
			{
				g_fDamage *= 0.5;
				client_print( id, print_center, "Reflected %d Damage", floatround( g_fDamage ) );
				return SKILL_USED;
			}
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillRest( SKILL_CALL:iCall, Int:id )
{
	#pragma unused id
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Rest", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN, .PP = 10, .Charges = 1, .DelayTime = 1.0 );
		case CALL_HELP:     return SkillHelp( "Restores health but causes you to sleep." );
		case CALL_BIND_DOWN:
		{
			return SKILL_USED;
		}
	}
	return SKILL_READY;
}

PM_FUNC_NORM_ATTRIB SKILL:SkillTeleport( SKILL_CALL:iCall, Int:id )
{
	switch( iCall )
	{
		case CALL_REGISTER: return SkillRegister( .Name = "Teleport", .Type = TYPE_PSYCHIC, .callTypes = CALL_BIND_DOWN|CALL_CUSTOM, .PP = 20, .Charges = 1, .DelayTime = 5.0 );
		case CALL_HELP:     return SkillHelp( "Teleports you to where you are aiming." );
		case CALL_BIND_DOWN:
		{
			if ( !SkillCheck( id, CHECK_BOMB, "Teleport" ) )
			{
				new Coord:cAimOrigin[3];
				PlayerAimOrigin( id, cAimOrigin );

				SoundCast( id );

				new Float:fDelayTime = StatClamp( id, STAT_SPEED, 5.0, 2.5 );

				EffectScreenFlash( .iPlayer = id,
									.iRed = 255,
									.iGreen = 0,
									.iBlue = 255,
									.iAlpha = 150,
									.fTime = fDelayTime,
									.iFadeFlags = FFADE_OUT
								);

				CoordToVector( cAimOrigin, gSkillVector[ id ] );

				SkillDelayCustomCall( id, fDelayTime );

				return SKILL_WAIT;
			}
		}
		case CALL_CUSTOM:
		{
			//Make sure the vector didn't get reset from a new round
			if ( !SkillCheck( id, CHECK_BOMB, "Teleport" ) && ( gSkillVector[ id ][ 0 ] || gSkillVector[ id ][ 1 ] || gSkillVector[ id ][ 2 ] ) )
			{
				SoundCast( id );

				new Float:fTime = 1.0;

				EffectScreenFlash( .iPlayer = id,
									.iRed = 255,
									.iGreen = 0,
									.iBlue = 255,
									.iAlpha = 150,
									.fTime = fTime,
									.iFadeFlags = FFADE_IN
								);

				new Coord:cOldOrigin[3];
				get_user_origin( id, cOldOrigin );

				EntitySetOrigin( id, gSkillVector[ id ] );

				EffectBeamPoints( .iPlayer = 0,
								.cStart = cOldOrigin,
								.cEnd = VectorToCoord( gSkillVector[ id ] ),
								.iSprite = SPRITE_TRAIL,
								.iStartFrame = 0,
								.iFrameRate = 10,
								.fLife = fTime,
								.iLineWidth = 10,
								.iNoiseAmp = 0,
								.iRed = 255,
								.iGreen = 0,
								.iBlue = 255,
								.iAlpha = 255,
								.iScrollSpeed = 10
							);

				UnStuck( id );

				return SKILL_USED;
			}
		}
	}
	return SKILL_READY;
}



